﻿<UserControl x:Class="EpiNEXT.WPF.View.Pages.Forms"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:view="clr-namespace:EpiNEXT.WPF.View"
             xmlns:local="clr-namespace:EpiNEXT.WPF.View.Pages"
             xmlns:controls="clr-namespace:EpiNEXT.WPF;assembly=EpiNEXT.WPF"
             xmlns:mui="http://firstfloorsoftware.com/ModernUI"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <!--<UserControl.DataContext>
        <local:FormsViewModel />
    </UserControl.DataContext>-->
    <UserControl.Style>
        <Style TargetType="{x:Type UserControl}">
            <Style.Triggers>
                <Trigger Property="Visibility" Value="Visible">
                    <Trigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.Opacity)">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
                                    <SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="1" />
                                </DoubleAnimationUsingKeyFrames>
                                <ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" DecelerationRatio="1" BeginTime="00:00:00" Duration="00:00:0.3">
                                    <SplineThicknessKeyFrame KeyTime="00:00:00" Value="20,0,0,0" />
                                    <SplineThicknessKeyFrame KeyTime="00:00:0.3" Value="0,0,0,0" />
                                </ThicknessAnimationUsingKeyFrames>
                            </Storyboard>
                        </BeginStoryboard>
                    </Trigger.EnterActions>
                </Trigger>
            </Style.Triggers>
        </Style>
    </UserControl.Style>
    <Grid x:Name="grdMain" VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition x:Name="row1" Height="24" />
            <RowDefinition x:Name="row2" Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        
        <StackPanel Grid.Row="0" Grid.Column="0" Grid.RowSpan="2">
            <!--<Label>WTF</Label>
            <Path HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="Fill" Width="14" Height="14" Fill="Black" StrokeThickness="1" Stroke="Black" Data="F1 M 57,42L 57,34L 32.25,34L 42.25,24L 31.75,24L 17.75,38L 31.75,52L 42.25,52L 32.25,42L 57,42 Z " />-->
            <controls:WindowNavButton x:Name="backButton" Click="backButton_Click" Margin="4, 0, 4, 0" />
        </StackPanel>
        
        <StackPanel VerticalAlignment="Top" Grid.Column="1">
            <StackPanel Grid.Row="0" Orientation="Horizontal">
                <Label HorizontalAlignment="Left" Margin="0, 0, 20, 10" FontSize="16" FontWeight="Bold" Foreground="{StaticResource DarkTextBrush}">FORMS</Label>
            </StackPanel>
        </StackPanel>
        <ScrollViewer x:Name="svMain" Grid.Row="1" Grid.Column="1" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Hidden" >
            <Grid>
                <controls:FormsSummaryView MaxHeight="{Binding ElementName=svMain, Path=ActualHeight}" ItemsSource="{Binding Forms}" 
                    VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.Row="1"
                    Visibility="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:Forms}, Mode=FindAncestor}, Path=Visibility}"
                    MouseDown="FormsSummaryView_MouseDown" />
            </Grid>
        </ScrollViewer>
    </Grid>
</UserControl>